using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using QFramework;

public class PlayerInput : MonoBehaviour
{
    public Vector3 movement;


    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.U)) UIGameMenu.ShowMenu(GameMenuType.Character);
        if (Input.GetKeyDown(KeyCode.I)) UIGameMenu.ShowMenu(GameMenuType.Backpack);
        if (Input.GetKeyDown(KeyCode.O)) UIGameMenu.ShowMenu(GameMenuType.Equipment);
        if (Input.GetKeyDown(KeyCode.P)) UIGameMenu.ShowMenu(GameMenuType.Ability);

        if (PlayerController.Instance.IsUI) return;
        movement.x = Input.GetAxisRaw("Horizontal");
        movement.z = Input.GetAxisRaw("Vertical");

        if (Input.GetKeyDown(KeyCode.Space)) PlayerController.Instance.SetTrigger("Roll");
        if (Input.GetKeyDown(KeyCode.C)) PlayerController.Instance.ToggleMode();
        if (Input.GetMouseButtonDown(0) && movement.magnitude <= 0f)
        {
            SkillData data = PlayerController.Instance.PrepareSkill(1001);
            PlayerController.Instance.SetTrigger(data.item.animationParameter);
        }
    }
}
